package com.feihao.zhou.demo01_Thread;

import java.io.File;
import java.io.IOException;

public class Test1 {
    public static void main(String[] args) throws IOException {
        //练习一：在当前模块下的aaa文件夹中创建一个a.txt文件


        /*File file = new File("dday12-code-fileAndIO\\aaa");
        //首先 判断aaa文件夹是否存在：
        if (!file.exists()){
            file.mkdirs();
        }
        File file1 = new File(file,"a.txt");
        boolean newFile = file1.createNewFile();
        System.out.println(newFile);*/

        File file = new File("dday12-code-fileAndIO\\aaa");

        //先判断存在的话，就麻烦点！！！
        if (file.exists()) {
            File file1 = new File(file, "a.txt");
            boolean newFile = file1.createNewFile();
            System.out.println(newFile);
        } else {
            file.mkdirs();
            File file1 = new File(file, "a.txt");
            boolean newFile = file1.createNewFile();
            System.out.println(newFile);
        }

    }
}
